﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sauces.Bussinees.Entities.Compras;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;

namespace Sauces.Repository.Mapping
{
   public  class ProveedorMap:EntityTypeConfiguration<Proveedor>
    {
       public ProveedorMap()
       {
           this.HasKey(t => t.Id);

           this.Property(p => p.RazonSocial).HasMaxLength(50).IsRequired();
           this.Property(p => p.Ruc).HasMaxLength(50).IsRequired();
           this.Property(p => p.NCuenta).HasMaxLength(50).IsRequired();
           this.Property(p => p.Direccion).HasMaxLength(50).IsRequired();
           this.Property(p => p.Nombre).HasMaxLength(50).IsRequired();
           this.Property(p => p.Apellidos).HasMaxLength(50).IsRequired();
           this.Property(p => p.Telefono).HasMaxLength(50).IsRequired();

           this.ToTable("Proveedor");

           this.Property(p => p.Id).HasColumnName("IdProveedor");
       }
    }
}
